package indi.kider.server.appclient.service.related;


import indi.kider.common.model.bill.*;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;
import pers.vankid.common.model.base.CommonResponse;
import pers.vankid.common.utils.page.PageRequest;
import pers.vankid.common.utils.page.PageResponse;

import java.util.List;

@FeignClient(value = "balance-bill")
public interface BillService {

    @PostMapping("/bill/list")
    CommonResponse query(@RequestBody PageRequest<Bill> request);

    @GetMapping(value = "/bill/{billId}")
    CommonResponse<Bill> queryById(@PathVariable(value = "billId") Long billId);

    @GetMapping("bill/total/{billAttribution}")
    CommonResponse getTotalUnpayed(@PathVariable(value = "billAttribution") Long billAttribution);

    @PutMapping("/bill/payState")
    CommonResponse<Bill> updatePayStatus(@RequestBody BillPay billPay);

    @PostMapping("bill/state")
    CommonResponse updateState(@RequestBody Long[] billIds);

    @DeleteMapping("bill/state/{billId}")
    CommonResponse updateState(@PathVariable(value = "billId") Long billId);


    @PostMapping("meter/list")
    CommonResponse<PageResponse<List<RentMeter>>> getRentMeterList(@RequestBody PageRequest<RentMeter> request);

    @PostMapping("meter/record/list")
    CommonResponse<PageResponse<List<MeterRecord>>> getMeterRecordList(@RequestBody PageRequest<RentMeter> request);

    @PutMapping("meter/name")
    CommonResponse update(@RequestBody MeterNameChange meterNameChange);
}
